package service;

import receiver.SystemActionReceiver;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
import android.util.Log;

public class MonitorService extends Service {

	BroadcastReceiver mReceiver = null;

	@Override
	public void onCreate() {
		super.onCreate();
		Log.d("MonitorService", "onCreate roi");
		// Register receiver that handles screen on and screen off logic
		IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
		filter.addAction(Intent.ACTION_SCREEN_OFF);
		mReceiver = new SystemActionReceiver();
		registerReceiver(mReceiver, filter);

	}

	@Override
	public void onStart(Intent intent, int startId) {

	}

	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		// TODO Auto-generated method stub
		return START_REDELIVER_INTENT;
	}

	@Override
	public IBinder onBind(Intent intent) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void onDestroy() {
		if (mReceiver != null)
			unregisterReceiver(mReceiver);

	}

}
